﻿using System;
using System.Collections.Generic;
using System.Text;
using QuanLyHocSinh.HeThongXuLy;
using System.Data;

namespace QuanLyHocSinh.HeThongLuuTru
{
    class NguoiDungDAO
    {
        public static bool KiemTraNguoiDung(NguoiDungDTO user) 
        { 
            string sql = "select * from NGUOIDUNG where TenNguoiDung = '" + user.TenNguoiDung + "' and MatKhauNguoiDung = '" + user.MatKhau + "'"; 
            DataTable dt = DataAccess.ExecQuery(sql); 
            if (dt.Rows.Count != 0) 
            { 
                return true;
            }
            else
            { 
                return false; 
            }
        }
 
        public static DataTable LayDanhSachNguoiDung() 
        { 
            string sql = "Select * from NGUOIDUNG"; 
            return DataAccess.ExecQuery(sql); 
        }

    }
}
